﻿using System;

namespace Finance.TodoSoft
{
	public static class EventHandlerExtension
	{
		public static void InvokeIfNotNull<T>(this EventHandler<T> handler, object sender, T args) where T : EventArgs
		{
			if (handler != null)
				handler(sender, args);
		}

		public static void InvokeIfNotNull(this EventHandler handler, object sender, EventArgs args)
		{
			if (handler != null)
				handler(sender, args);
		}
	}
}
